﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Interface.Volcengine.DTO
{
    public class VolcengineResponseBase<T>
    {
        public ResponseMetadata ResponseMetadata { get; set; }
        [JsonProperty("request_id")]
        public string RequestId { get; set; }
        [JsonProperty("time_elapsed")]
        public string TimeElapsed { get; set; }
        [JsonProperty("Code")]
        public int code { get; set; }
        [JsonProperty("message")]
        public string Message { get; set; }
        [JsonProperty("data")]
        public T Data { get; set; }

        public bool IsSuccess { get { return code == 10000; } }
    }
    public class ResponseMetadata
    {
        public string RequestId { get; set; }
        public string Action { get; set; }
        public string Version { get; set; }
        public string Service { get; set; }
        public string Region { get; set; }
        public ErrorInfo Error { get; set; }
    }
    public class ErrorInfo
    {
        public string Code { get; set; }
        public string Message { get; set; }
    }
}
